<?php
namespace app\api\validate;

use think\Validate;

class CardValidate extends Validate{
    protected $rule =   [
        'id'                   => 'require|number',
        'user_id|用户ID'       => 'require|number',
        'admin_id|店铺ID'      => 'require|number',
        'card_id|次卡ID'       => 'require|number',
        'curr|页数'            => 'require|number',
        'limit|条数'           => 'require|number',
        'remarks|备注'         => 'length:1,255',
        'type|类型'            => 'require|number',
        'status|状态'          => 'require|number',
        'to_user_id|'          => 'integer',
        'number|数量'          => 'require|number',
        'price|价格'           => 'require|gt:0',
        'pay_type|支付方式'     => 'require|integer',
    ];
    
    protected $scene = [
        'list'           => ['user_id', 'status', 'curr', 'limit'],
        'show'           => ['card_id'],
        
        'order_card_add' => ['card_id', 'admin_id', 'user_id', 'to_user_id', 'remarks', 'number', 'price', 'pay_type'],
        'pay_order_card' => ['order_card_id'],
    ];
}